/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.storage.entity;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.NotBlank;

import com.jeesite.common.mybatis.annotation.JoinTable;
import org.hibernate.validator.constraints.Length;
import java.util.List;
import com.jeesite.common.collect.ListUtils;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 商品Entity
 */
@Table(name="biz_goods", alias="a", columns={
		@Column(name="id", attrName="id", label="唯一标识", isPK=true),
		@Column(name="brand_id", attrName="brandId", label="品牌id"),
		@Column(name="cate_id", attrName="cateId", label="分类id"),
		@Column(name="category", attrName="category", label="商品大类"),
		@Column(name="thumbnail", attrName="thumbnail", label="缩略图"),
		@Column(name="picture", attrName="picture", label="图片"),
		@Column(name="platform", attrName="platform", label="平台编号"),
		@Column(name="code", attrName="code", label="编码", queryType=QueryType.LIKE),
		@Column(name="name", attrName="name", label="名称", queryType=QueryType.LIKE),
		@Column(name="material", attrName="material", label="材质", queryType=QueryType.LIKE),
		@Column(name="place", attrName="place", label="产地", queryType=QueryType.LIKE),
		@Column(name="price", attrName="price", label="吊牌价"),
		@Column(name="year", attrName="year", label="产品年份"),
		@Column(name="season", attrName="season", label="产品季节"),
		@Column(name="member_price", attrName="memberPrice", label="普通会员价"),
		@Column(name="vip_price", attrName="vipPrice", label="VIP会员价"),
		@Column(name="agent_price", attrName="agentPrice", label="代购费"),
		@Column(name="create_by", attrName="createBy", label="创建者", isQuery=false),
		@Column(name="create_date", attrName="createDate", label="创建时间", isQuery=false),
		@Column(name="update_by", attrName="updateBy", label="更新者", isQuery=false),
		@Column(name="update_date", attrName="updateDate", label="更新时间", isQuery=false)
	},orderBy="a.update_date DESC"
)
public class Goods extends DataEntity<Goods> {
	
	private static final long serialVersionUID = 1L;
	private String brandId;		// 品牌id
	private String cateId;		// 分类id
	private String category;		// 商品大类
	private String thumbnail;		// 缩略图
	private String picture;		// 图片【多个直接用"|"分割】
	private String platform;		// 平台编号
	private String code;		// 编码
	private String name;		// 名称
	private String material;		// 材质
	private String place;		// 产地
	private Double price;		// 吊牌价
	private Double memberPrice;		// 普通会员价
	private Double vipPrice;		// VIP会员价
	private Double agentPrice;		// 代购费
	private String year;		// 产品年份
	private String season;		// 产品季节
	private List<GoodsSpec> goodsSpecList = ListUtils.newArrayList();		// 子表列表
	private Brand brand; //品牌
	private Category cate; //分类

	public Goods() {
		this(null);
	}

	public Goods(String id){
		super(id);
	}

	@NotBlank(message="品牌不能为空")
	public String getBrandId() {
		return brandId;
	}

	public void setBrandId(String brandId) {
		this.brandId = brandId;
	}

	@NotBlank(message="分类不能为空")
	public String getCateId() {
		return cateId;
	}

	public void setCateId(String cateId) {
		this.cateId = cateId;
	}

	public void setCategory(String category) {
		this.category = category;
	}

	public String getCategory() {
		return category;
	}

	public String getThumbnail() {
		return thumbnail;
	}

	public void setThumbnail(String thumbnail) {
		this.thumbnail = thumbnail;
	}

	@NotBlank(message="素材不能为空")
	public String getPicture() {
		return picture;
	}

	public void setPicture(String picture) {
		this.picture = picture;
	}

	public String getPlatform() {
		return platform;
	}

	public void setPlatform(String platform) {
		this.platform = platform;
	}

	@NotBlank(message="编码不能为空")
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}
	
	@NotBlank(message="名称不能为空")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Double getPrice() {
		return price;
	}

	public void setPrice(Double price) {
		this.price = price;
	}

	public Double getMemberPrice() {
		return memberPrice;
	}

	public void setMemberPrice(Double memberPrice) {
		this.memberPrice = memberPrice;
	}

	public Double getVipPrice() {
		return vipPrice;
	}

	public void setVipPrice(Double vipPrice) {
		this.vipPrice = vipPrice;
	}

	public Double getAgentPrice() {
		return agentPrice;
	}

	public void setAgentPrice(Double agentPrice) {
		this.agentPrice = agentPrice;
	}
	
	@NotBlank(message="材质不能为空")
	@Length(min=0, max=255, message="材质长度不能超过 255 个字符")
	public String getMaterial() {
		return material;
	}

	public void setMaterial(String material) {
		this.material = material;
	}
	
	@Length(min=0, max=255, message="产地长度不能超过 255 个字符")
	public String getPlace() {
		return place;
	}

	public void setPlace(String place) {
		this.place = place;
	}

	public String getYear() {
		return year;
	}

	public void setYear(String year) {
		this.year = year;
	}

	public String getSeason() {
		return season;
	}

	public void setSeason(String season) {
		this.season = season;
	}

	public Brand getBrand() {
		return brand;
	}

	public void setBrand(Brand brand) {
		this.brand = brand;
	}

	public Category getCate() {
		return cate;
	}

	public void setCate(Category cate) {
		this.cate = cate;
	}
	
	public List<GoodsSpec> getGoodsSpecList() {
		return goodsSpecList;
	}

	public void setGoodsSpecList(List<GoodsSpec> goodsSpecList) {
		this.goodsSpecList = goodsSpecList;
	}
}